FROM python:3.11-alpine3.18 as Base
MAINTAINER e4ting e4ting@qq.com

ENV FUSE_LIBRARY_PATH=/usr/lib/libfuse.so.2

COPY requirments.txt /tmp/requirments.txt

RUN echo 'https://mirrors.aliyun.com/alpine/v3.18/main'       >  /etc/apk/repositories
RUN echo 'https://mirrors.aliyun.com/alpine/v3.18/community'  >> /etc/apk/repositories
RUN apk add curl wget fuse gcc python3-dev libc-dev curl-dev linux-headers openblas-dev build-base
RUN python3 -m pip install -i https://mirrors.aliyun.com/pypi/simple -r /tmp/requirments.txt
RUN ln -s supervisorctl /usr/local/bin/spc


# FROM golang:alpine3.18 as GoBin
# COPY --from=Base /etc/apk/repositories     /etc/apk/repositories
# COPY wick /wick
# WORKDIR /wick
# RUN apk add make gcc musl-dev
# RUN go env -w GOPROXY='https://goproxy.cn,direct'
# RUN make && make grpc

FROM python:3.11-alpine3.18
MAINTAINER e4ting e4ting@qq.com

ENV PS1='\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\$ '
ENV TZ=Asia/Shanghai
ENV LANG=en_US.UTF-8
ENV EVENTLET_HUB=select
ENV EVENTLET_NO_GREENDNS=yes
ENV FUSE_LIBRARY_PATH=/usr/lib/libfuse.so.2

COPY --from=Base /etc/apk/repositories     /etc/apk/repositories
COPY --from=Base /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=Base /usr/local/bin            /usr/local/bin
COPY .                                     /code
# COPY --from=GoBin /wick/bin                /code/service

RUN apk add curl wget fuse vim nmap
RUN python3 -m pip config  set global.index-url https://mirrors.aliyun.com/pypi/simple
RUN python3 -m pip config  set global.timeout 600

WORKDIR /code
